package com.ruben.simplescaffold.mapper.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.core.convert.converter.Converter;

import com.ruben.simplescaffold.entity.UserDetail;
import com.ruben.simplescaffold.pojo.vo.UserVO;

/**
 * 用户mapstruct转换mapper
 *
 * @author <achao1441470436@gmail.com>
 * @since 2022/3/23 19:18
 */
@Mapper(componentModel = "spring")
public interface MapUserMapper extends Converter<UserDetail, UserVO> {

    /**
     * po转vo
     *
     * @param userDetail po
     * @return vo
     */
    @Override
    @Mapping(source = "username", target = "uname")
    @Mapping(source = "password", target = "pwd")
    UserVO convert(UserDetail userDetail);

}
